#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <algorithm>

using namespace std;

class Solution {
public:
    string destCity(vector<vector<string>>& paths) {
        string dest;
        unordered_set<string> cityASet;
        for (auto elem : paths) {
            cityASet.insert(elem[0]);
        }

        for (auto elem : paths) {
            if (cityASet.find(elem[1]) == cityASet.end()) {
                dest = elem[1];
            }
        }
        return dest;
    }
};

int main()
{
    Solution s;
    vector<vector<string>> path{{"pYyNGfBYbm","wxAscRuzOl"},{"kzwEQHfwce","pYyNGfBYbm"}};
    cout << s.destCity(path) << endl;

    return 0;
}